<template>
  <div id="app" style="height: 100%;">
    <router-view></router-view>
  </div>
</template>

<script>

export default {
  name: 'app',
  created(){

  },
  created(){
    if(sessionStorage.leftMenus){
      this.$store.commit(
        "initRouterMenus",
        JSON.parse(sessionStorage.leftMenus)
      );
      this.$store.commit("initRouterIndex",sessionStorage.routerIndex)
    }
  },
  computed:{
    if(){},
    leftMenus(){
      return this.$store.state.routerMenus;
    },
    routerIndex() {
      return this.$store.state.routerIndex;
    },
  },
  watch:{
    leftMenus:{
      handler(newValue){
        sessionStorage.leftMenus = JSON.stringify(newValue);
      },
      deep:true
    },
    routerIndex:{
      handler(newValue){
        sessionStorage.routerIndex = newValue;
      },
      deep:true
    }
  }
}
</script>

<style>
#app{
  height: 100%;
}
body{
  width: 100%;
  height: 100%;
  padding: 0%;
  border: 0cap;
  overflow-x:hidden;
}


</style>
